package com.RedRiver.hospitalsystem.personal_service.client;

import com.RedRiver.hospitalsystem.personal_service.client.param.*;
import com.RedRiver.hospitalsystem.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * contextId是项目名，name是client的名字
 */
@FeignClient(contextId = "WorkerClient",name="personal-service",path="personalService/worker")
public interface WorkerClient {
    @PostMapping("/findAllWorker")
     Result findPageAllWorker(@RequestBody PageForm form);

    @PostMapping("/findWorkerById/{id}")
     Result findWorkerById(@PathVariable("id") Integer id);

    @PostMapping("/findAllWorkerByName")
     Result findPageAllWorkerByName(@RequestBody WorkerNamePageForm form);

    @PostMapping("/findAllWorkerByDepartmentId")
     Result findPageAllWorkerByDepartmentId(@RequestBody WorkerPageForm form);

    @PostMapping("/findAllWorkerByWorkerSex")
     Result findPageAllWorkerByWorkerSex(@RequestBody WorkerSexPageForm form);

    @PostMapping("/createWorker")
     Result createWorker(@RequestBody WorkerForm workerForm);

    @PostMapping("/updateWorker")
     Result updateWorker(@RequestBody NewUpdateWorker newUpdateWorker);

    @PostMapping("/delWorker/{workerId}")
     Result delWorkerById(@PathVariable("workerId") Integer workerId);

}
